package com.starinside.wp.service.impl;

import com.starinside.wp.domain.Children;
import com.starinside.wp.repository.ChildrenRepository;
import com.starinside.wp.service.ChildrenService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import javax.transaction.Transactional;
import java.util.*;
import java.util.stream.Collectors;


/**
 * *******************************
 * Created by Tim.
 * form com.matt
 * on 2017/7/13
 * *******************************
 */
@Service
@Slf4j
public class ChildrenServiceImpl implements ChildrenService {

    @Autowired
    private ChildrenRepository childrenRepository;

    @Override
    public Children getById(String id) {
        Optional<Children> ret = childrenRepository.findById(id);

        if(ret.isPresent()){
            return ret.get();
        }

        return null;
    }


}
